#pragma once

#include <iostream>
#include <vector>
#include <string>
#include <unistd.h>
#include <functional>

namespace ThreadMoudle
{
    class Lock
    {
    public:
        Lock(pthread_mutex_t* mutex) : _mutex(mutex)
        {
            pthread_mutex_lock(_mutex);
        }
        ~Lock() 
        {
            pthread_mutex_unlock(_mutex);
        }
    private: 
        pthread_mutex_t *_mutex;
    };
}